#include <iostream>
using namespace std;

int main() { // 测试位运算的类型提升行为。
  wchar_t w;
  char32_t uc;
  short ss = 0;
  unsigned short us = 0;
  cout << "I: " << typeid(0).name() << endl;
  cout << "L: " << typeid(0L).name() << endl;
  cout << "U: " << typeid(0U).name() << endl;
  cout << "UL: " << typeid(0UL).name() << endl;
  cout << "LL: " << typeid(0LL).name() << endl;
  cout << "ULL: " << typeid(0ULL).name() << endl;
  cout << "('a'|'a'): " << typeid('a' | 'a').name() << endl;
  cout << "(w  | w ): " << typeid(w | w).name() << endl;
  cout << "(ss | ss): " << typeid(ss | ss).name() << endl;
  cout << "(us | us): " << typeid(us | us).name() << endl;
  cout << "(ss | us): " << typeid(ss | us).name() << endl; // 至少提升到int
  cout << "(uc | uc): " << typeid(uc | uc).name() << endl; // U
  cout << "(0U | 0U): " << typeid(0U | 0U).name() << endl; // U
  cout << "(0U | 0 ): " << typeid(0U | 0).name() << endl;  // U
  cout << "(0L | 0L): " << typeid(0L | 0L).name() << endl; // L
  cout << "(0L | 0 ): " << typeid(0L | 0).name() << endl;  // L
  cout << "(0L | 0U): " << typeid(0L | 0U).name() << endl; // L，VC是UL
  cout << "(0L |0UL): " << typeid(0L | 0UL).name() << endl;   // UL
  cout << "(0LL|0UL): " << typeid(0LL | 0UL).name() << endl;  // ULL，VC是LL
  cout << "(0LL|0ULL):" << typeid(0LL | 0ULL).name() << endl; // ULL
}
/* 大致结论：
位运算时int以下提升到int。有更宽的类型时：
两边不等宽就转更宽的类型。
等宽不同类型转无符号类型。
*/